/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						       script_event.h

	$Header: /game/script_event.h $

	$NoKeywords: $

 ************************************************************************/

#if !defined( SCRIPT_EVENT_H_INCLUDED )
#define SCRIPT_EVENT_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <cassert>
#include <iosfwd>

#include "abstract_script_action_ptr.h"
#include "counted_ptr.h"

// --------------------------------------------------------------------------
// t_script_event class
// --------------------------------------------------------------------------

class t_script_event : public t_counted_object
{
public:
	// Types
	typedef t_abstract_script_action		t_script;
	typedef t_abstract_script_action_ptr	t_script_ptr;

	// Constructors/Destructor
	t_script_event();
	t_script_event( t_script_event const & other );
	virtual ~t_script_event() = 0;

	// Member functions
	t_script const &	get_script() const;
	void				set_script( t_script_ptr new_script_ptr );

	// Operators
	t_script_event &	operator=( t_script_event const & other );

protected:
	// Member functions
	bool	read(
				std::streambuf &	stream,
				int					version );
	bool	read_from_map(
				std::streambuf &	stream,
				int					format_version );
	bool	write( std::streambuf & stream ) const;

private:
	// Data members
	t_script_ptr	m_script_ptr;
};

#endif // !defined( SCRIPT_EVENT_H_INCLUDED )
